package com.geek.pokermanager.model;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.util.Map;

import ydh.cicada.api.Column;
import ydh.cicada.api.Entity;
import ydh.cicada.api.Id;

@Entity(name="poker_group")
public class PokerGroup implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name="poker_group_id")
	private String pokerGroupId;
	
	@Column(name="poker_group_name")
	private String pokerGroupName;
	
	@Column(name="poker_group_no")
	private String pokerGroupNo;
	
	@Column(name="poker_store_id")
	private String pokerStoreId;
	
	@Column(name="poker_group_desc")
	private String pokerGroupDesc;
	
	@Column(name="pokerdata")
	private Map pokerData;
	
	private byte[] pokerCovertData;
	
	public String getPokerGroupId() {
		return pokerGroupId;
	}
	public void setPokerGroupId(String pokerGroupId) {
		this.pokerGroupId = pokerGroupId;
	}
	public String getPokerGroupName() {
		return pokerGroupName;
	}
	public void setPokerGroupName(String pokerGroupName) {
		this.pokerGroupName = pokerGroupName;
	}

	public String getPokerGroupNo() {
		return pokerGroupNo;
	}
	public void setPokerGroupNo(String pokerGroupNo) {
		this.pokerGroupNo = pokerGroupNo;
	}
	public String getPokerStoreId() {
		return pokerStoreId;
	}
	public void setPokerStoreId(String pokerStoreId) {
		this.pokerStoreId = pokerStoreId;
	}
	public String getPokerGroupDesc() {
		return pokerGroupDesc;
	}
	public void setPokerGroupDesc(String pokerGroupDesc) {
		this.pokerGroupDesc = pokerGroupDesc;
	}
	public Map getPokerData() {
		return pokerData;
	}
	public void setPokerData(Map pokerData) {
		this.pokerData = pokerData;
	}
	public void setPokerDataByte(byte[] bytes) throws IOException, ClassNotFoundException {
		ByteArrayInputStream bais;  
        ObjectInputStream in = null;  
        try{  
            bais = new ByteArrayInputStream(bytes);  
            in = new ObjectInputStream(bais);  
            this.pokerData = (Map) in.readObject();
        }finally{  
            if(in != null){  
                try {  
                    in.close();  
                } catch (IOException e) {  
                    throw e;
                }  
            }  
        }  
	}
	public byte[] getPokerCovertData() {
		return pokerCovertData;
	}
	public void setPokerCovertData(byte[] pokerCovertData) throws ClassNotFoundException, IOException {
		setPokerDataByte(pokerCovertData);
	}
	
	
}
